﻿using System.Web.UI.WebControls;
using PortalCurriculo.Util.Translation;

namespace PortalCurriculo.WebUI.Constants
{
    public class Button
    {
        public Button(string pagePath, string cssClass)
        {
            PagePath = pagePath;
            CssClass = cssClass;
        }

        protected string PagePath { get; set; }
        protected string CssClass{ get; set; }
        private const string Id = "[Id]";

        public ImageButton DeleteImage
        {
            get
            {
                return new ImageButton
                           {
                               ID = "imbExcluir",
                               CommandArgument = Id,
                               ImageUrl = Image.DeleteButton,
                               AlternateText = Translator.TranslateMessage(Helpers.Messages.Excluir, PagePath),
                               CssClass=CssClass
                           };
            }
        }

        public ImageButton EditImage
        {
            get
            {
                return new ImageButton
                {
                    ID = "imbEditar",
                    CommandArgument = Id,
                    ImageUrl = Image.EditButton,
                    AlternateText = Translator.TranslateMessage(Helpers.Messages.Editar, PagePath),
                    CssClass=CssClass
                };
            }
        }

        public ImageButton DetailsImage
        {
            get
            {
                return new ImageButton
                {
                    ID = "imbDetalhes",
                    CommandArgument = Id,
                    ImageUrl = Image.DetailsButton,
                    AlternateText = Translator.TranslateMessage(Helpers.Messages.Detalhes, PagePath),
                    CssClass = CssClass
                };
            }
        }

        public ImageButton ViewImage
        {
            get
            {
                return new ImageButton
                {
                    ID = "imbVisualizar",
                    CommandArgument = Id,
                    ImageUrl = Image.ViewButton,
                    AlternateText = Translator.TranslateMessage(Helpers.Messages.Visualizar, PagePath),
                    CssClass = CssClass
                };
            }
        }
    }
}